package com.ruicar.afs.cloud.basic.caseInterface.controller;

import com.ruicar.afs.cloud.basic.caseInterface.service.BasicLoanAmountService;
import com.ruicar.afs.cloud.basic.caseInterface.vo.BasicExternalLoanAmountVo;
import com.ruicar.afs.cloud.common.core.log.annotation.SysLog;
import com.ruicar.afs.cloud.common.core.util.IResponse;
import io.swagger.annotations.Api;
import lombok.AllArgsConstructor;
import lombok.extern.slf4j.Slf4j;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@AllArgsConstructor
@Api("历史贷额")
@RequestMapping("/externalLoanAmount")
public class BasicLoanAmountController {
    private BasicLoanAmountService basicLoanAmountService;
    @PostMapping("/loanhistoryFromContract")
    @SysLog("历史贷款金额")
    public IResponse<List<BasicExternalLoanAmountVo>> loanhistoryFromContract(@RequestParam("borrowerCertno") String borrowerCertno, @RequestParam("coborrowerCertno") String coborrowerCertno) {
        List<BasicExternalLoanAmountVo> list=basicLoanAmountService.getLoanAmountHistory(borrowerCertno, coborrowerCertno);
        return IResponse.success(list);
    }
}